#include <iostream>
#include <algorithm>
#include <vector>
#include <ctime>
using namespace std;

struct data { int da, p; };
struct cmpclass { bool operator()(data a, data b) { return a.da > b.da; } } cmp;

vector<data> da;
typedef vector<data>::iterator data_it;
int k;

int main()
{
	ios::sync_with_stdio(false);
	cin >> k;
	da.resize(3*k);
	for (int i = 0; i < 3*k; i++) { cin >> da[i].da; da[i].p = i+1; }
	sort(da.begin(), da.end(), cmp);
	int s1 = 0, s2 = 0;
	for (int i = 0; i < k; i++) s1 += da[i].da;
	for (int i = k; i < 2*k; i++) s2 += da[i].da;
	while (s1 <= k*500 || s2 <= k*500) {
		int t1 = rand()%k, t2 = rand()%k+k;
		s1 -= (da[t1].da - da[t2].da);
		s2 += (da[t1].da - da[t2].da);
		swap(da[t1], da[t2]);
	}
	for (data_it it = da.begin(); it != da.end(); ++it)
		cout << (*it).p << "\n";
}

